{include file="header.htm" /}
<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-20">
    {include file="bar.htm" /}
    <form class="form-horizontal" id="post_form">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit"><label for="local">核销功能</label></dt>
                <dd class="opt">
                    <label class="curpoin">
                        <input name="openVerify" value="1" type="radio" {if condition="!empty($data.openVerify)"}checked="checked"{/if}>开启
                    </label>
                    &nbsp;
                    <label class="curpoin">
                        <input name="openVerify" value="0" type="radio" {if condition="empty($data.openVerify)"} checked="checked"{/if}>关闭
                        <!-- onclick="closeVerifyGoods();" -->
                    </label>
                    <p class="notic">关闭后，所以核销相关功能均不生效</p>
                    <!-- <p class="notic2">核销功能开启则允许一键上架所有核销相关商品 <a href="JavaScript:void(0);" onclick="openVerifyGoods();">[一键上架]</a> </p> -->
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><label for="local">后台二次核销</label></dt>
                <dd class="opt">
                    <label class="curpoin">
                        <input name="openSecondVerify" value="1" type="radio" {if condition="!empty($data.openSecondVerify)"}checked="checked"{/if}>开启
                    </label>
                    &nbsp;
                    <label class="curpoin">
                        <input name="openSecondVerify" value="0" type="radio" {if condition="empty($data.openSecondVerify)"} checked="checked"{/if}>关闭
                    </label>
                    <p class="notic">开启后，后台操作订单核销时，需要输入核销码二次验证</p>
                </dd>
            </dl>
            <div class="bot">
                <a href="JavaScript:void(0);" onclick="checkForm();" class="ncap-btn-big ncap-btn-green mt20" id="submitBtn">保存</a>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    // function closeVerifyGoods() {
    //     layer.confirm('关闭核销功能则将下架所有核销相关的商品！', {
    //         shade: layer_shade,
    //         area: ['480px', '190px'],
    //         move: false,
    //         title: '提示',
    //         btnAlign:'r',
    //         closeBtn: 3,
    //         btn: ['我已知晓'],
    //         success: function () {
    //             $(".layui-layer-content").css('text-align', 'left');
    //         }
    //     });
    // }

    // function openVerifyGoods() {
    //     layer.confirm('确认一键上架所有核销相关商品？', {
    //         shade: layer_shade,
    //         area: ['480px', '190px'],
    //         move: false,
    //         title: '提示',
    //         btnAlign:'r',
    //         closeBtn: 3,
    //         btn: ['确定', '取消'],
    //         success: function () {
    //             $(".layui-layer-content").css('text-align', 'left');
    //         }
    //     }, function () {
    //         layer_loading('正在处理');
    //         $.ajax({
    //             url : "{:weapp_url('Verify/Verify/openVerifyGoods')}",
    //             data: {_ajax: 1},
    //             type: 'post',
    //             dataType: 'json',
    //             success: function(res) {
    //                 layer.closeAll();
    //                 if (1 == res.code) {
    //                     layer.msg(res.msg, {time: 2000}, function() {
    //                         window.location.reload();
    //                     });
    //                 } else {
    //                     layer.alert(res.msg, {icon: 0, title: false, closeBtn: false});
    //                 }
    //             }
    //         });
    //     }, function (index) {
    //         layer.closeAll(index);
    //     });
    // }

    // 判断输入框是否为空
    function checkForm() {
        layer_loading('正在处理');
        $.ajax({
            url : "{:weapp_url('Verify/Verify/config')}",
            data: $('#post_form').serialize(),
            type: 'post',
            dataType: 'json',
            success: function(res) {
                layer.closeAll();
                if (1 == res.code) {
                    layer.msg(res.msg, {time: 2000}, function() {
                        window.location.reload();
                    });
                } else {
                    layer.alert(res.msg, {icon: 0});
                }
            }
        });
    }
</script>
{include file="footer.htm" /}